﻿namespace HRM.CORE
{

    using APP.HELPER.Data.Helper;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;

    public class HRM_PAYINSURANCE_C66AHD
    {
        private Guid m_C66aHDID;
        private string m_Condition;
        private string m_Description;
        private string m_EmployeeCode;
        private string m_EmployeeName;
        private decimal m_Money;
        private Guid m_PayInsuranceTableListID;
        private int m_ProgressAbsent;
        private decimal m_Salary;
        private string m_SocialInsuranceCode;
        private int m_TermAbsent;
        private string m_Time;
        private int m_Type;

        public HRM_PAYINSURANCE_C66AHD()
        {
            this.m_C66aHDID = Guid.Empty;
            this.m_PayInsuranceTableListID = Guid.Empty;
            this.m_EmployeeCode = "";
            this.m_EmployeeName = "";
            this.m_SocialInsuranceCode = "";
            this.m_Condition = "";
            this.m_Salary = 0M;
            this.m_Time = "";
            this.m_TermAbsent = 0;
            this.m_ProgressAbsent = 0;
            this.m_Money = 0M;
            this.m_Type = 0;
            this.m_Description = "";
        }

        public HRM_PAYINSURANCE_C66AHD(Guid C66aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, decimal Salary, string Time, int TermAbsent, int ProgressAbsent, decimal Money, int Type, string Description)
        {
            this.m_C66aHDID = C66aHDID;
            this.m_PayInsuranceTableListID = PayInsuranceTableListID;
            this.m_EmployeeCode = EmployeeCode;
            this.m_EmployeeName = EmployeeName;
            this.m_SocialInsuranceCode = SocialInsuranceCode;
            this.m_Condition = Condition;
            this.m_Salary = Salary;
            this.m_Time = Time;
            this.m_TermAbsent = TermAbsent;
            this.m_ProgressAbsent = ProgressAbsent;
            this.m_Money = Money;
            this.m_Type = Type;
            this.m_Description = Description;
        }

        public string Delete()
        {
            string[] myParams = new string[] { "@C66aHDID" };
            object[] myValues = new object[] { this.m_C66aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C66AHD_Delete", myParams, myValues);
        }

        public string Delete(Guid C66aHDID)
        {
            string[] myParams = new string[] { "@C66aHDID" };
            object[] myValues = new object[] { C66aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C66AHD_Delete", myParams, myValues);
        }

        public string Delete(SqlConnection myConnection, Guid C66aHDID)
        {
            string[] myParams = new string[] { "@C66aHDID" };
            object[] myValues = new object[] { C66aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C66AHD_Delete", myParams, myValues);
        }

        public string Delete(SqlTransaction myTransaction, Guid C66aHDID)
        {
            string[] myParams = new string[] { "@C66aHDID" };
            object[] myValues = new object[] { C66aHDID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C66AHD_Delete", myParams, myValues);
        }

        public bool Exist(Guid C66aHDID)
        {
            bool hasRows = false;
            string[] myParams = new string[] { "@C66aHDID" };
            object[] myValues = new object[] { C66aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_PAYINSURANCE_C66AHD_Get", myParams, myValues);
            if (reader != null)
            {
                hasRows = reader.HasRows;
                reader.Close();
                helper.Close();
                reader = null;
            }
            return hasRows;
        }

        public string Get(Guid C66aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C66aHDID" };
            object[] myValues = new object[] { C66aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_PAYINSURANCE_C66AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C66aHDID = reader.GetGuid(reader.GetOrdinal("C66aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_Salary = Convert.ToDecimal(reader["Salary"]);
                    this.m_Time = Convert.ToString(reader["Time"]);
                    this.m_TermAbsent = Convert.ToInt32(reader["TermAbsent"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_Type = Convert.ToInt32(reader["Type"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlConnection myConnection, Guid C66aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C66aHDID" };
            object[] myValues = new object[] { C66aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myConnection, "HRM_PAYINSURANCE_C66AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C66aHDID = reader.GetGuid(reader.GetOrdinal("C66aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_Salary = Convert.ToDecimal(reader["Salary"]);
                    this.m_Time = Convert.ToString(reader["Time"]);
                    this.m_TermAbsent = Convert.ToInt32(reader["TermAbsent"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_Type = Convert.ToInt32(reader["Type"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public string Get(SqlTransaction myTransaction, Guid C66aHDID)
        {
            string str = "";
            string[] myParams = new string[] { "@C66aHDID" };
            object[] myValues = new object[] { C66aHDID };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader(myTransaction, "HRM_PAYINSURANCE_C66AHD_Get", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_C66aHDID = reader.GetGuid(reader.GetOrdinal("C66aHDID"));
                    this.m_PayInsuranceTableListID = reader.GetGuid(reader.GetOrdinal("PayInsuranceTableListID"));
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_EmployeeName = Convert.ToString(reader["EmployeeName"]);
                    this.m_SocialInsuranceCode = Convert.ToString(reader["SocialInsuranceCode"]);
                    this.m_Condition = Convert.ToString(reader["Condition"]);
                    this.m_Salary = Convert.ToDecimal(reader["Salary"]);
                    this.m_Time = Convert.ToString(reader["Time"]);
                    this.m_TermAbsent = Convert.ToInt32(reader["TermAbsent"]);
                    this.m_ProgressAbsent = Convert.ToInt32(reader["ProgressAbsent"]);
                    this.m_Money = Convert.ToDecimal(reader["Money"]);
                    this.m_Type = Convert.ToInt32(reader["Type"]);
                    this.m_Description = Convert.ToString(reader["Description"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public DataTable GetList()
        {
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PAYINSURANCE_C66AHD_GetList");
        }

        public DataTable GetList(Guid PayInsuranceTableListID)
        {
            string[] myParams = new string[] { "@PayInsuranceTableListID" };
            object[] myValues = new object[] { PayInsuranceTableListID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PAYINSURANCE_C66AHD_GetListByPayInsuranceTableList", myParams, myValues);
        }

        public DataTable GetListByType(Guid PayInsuranceTableListID, int Type)
        {
            string[] myParams = new string[] { "@PayInsuranceTableListID", "@Type" };
            object[] myValues = new object[] { PayInsuranceTableListID, Type };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PAYINSURANCE_C66AHD_GetListByType", myParams, myValues);
        }

        public DataTable GetListType(Guid PayInsuranceTableListID)
        {
            string[] myParams = new string[] { "@PayInsuranceTableListID" };
            object[] myValues = new object[] { PayInsuranceTableListID };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_PAYINSURANCE_C66AHD_GetListType", myParams, myValues);
        }

        public string Insert()
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { this.m_C66aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_Salary, this.m_Time, this.m_TermAbsent, this.m_ProgressAbsent, this.m_Money, this.m_Type, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C66AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction)
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { this.m_C66aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_Salary, this.m_Time, this.m_TermAbsent, this.m_ProgressAbsent, this.m_Money, this.m_Type, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C66AHD_Insert", myParams, myValues);
        }

        public string Insert(Guid C66aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, decimal Salary, string Time, int TermAbsent, int ProgressAbsent, decimal Money, int Type, string Description)
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { C66aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Salary, Time, TermAbsent, ProgressAbsent, Money, Type, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C66AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlConnection myConnection, Guid C66aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, decimal Salary, string Time, int TermAbsent, int ProgressAbsent, decimal Money, int Type, string Description)
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { C66aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Salary, Time, TermAbsent, ProgressAbsent, Money, Type, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C66AHD_Insert", myParams, myValues);
        }

        public string Insert(SqlTransaction myTransaction, Guid C66aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, decimal Salary, string Time, int TermAbsent, int ProgressAbsent, decimal Money, int Type, string Description)
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { C66aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Salary, Time, TermAbsent, ProgressAbsent, Money, Type, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C66AHD_Insert", myParams, myValues);
        }

        public string NewID()
        {
            return SqlHelper.GenCode("HRM_PAYINSURANCE_C66AHD", "C66aHDID", "CV");
        }

        public string Update()
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { this.m_C66aHDID, this.m_PayInsuranceTableListID, this.m_EmployeeCode, this.m_EmployeeName, this.m_SocialInsuranceCode, this.m_Condition, this.m_Salary, this.m_Time, this.m_TermAbsent, this.m_ProgressAbsent, this.m_Money, this.m_Type, this.m_Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C66AHD_Update", myParams, myValues);
        }

        public string Update(Guid C66aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, decimal Salary, string Time, int TermAbsent, int ProgressAbsent, decimal Money, int Type, string Description)
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { C66aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Salary, Time, TermAbsent, ProgressAbsent, Money, Type, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery("HRM_PAYINSURANCE_C66AHD_Update", myParams, myValues);
        }

        public string Update(SqlConnection myConnection, Guid C66aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, decimal Salary, string Time, int TermAbsent, int ProgressAbsent, decimal Money, int Type, string Description)
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { C66aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Salary, Time, TermAbsent, ProgressAbsent, Money, Type, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myConnection, "HRM_PAYINSURANCE_C66AHD_Update", myParams, myValues);
        }

        public string Update(SqlTransaction myTransaction, Guid C66aHDID, Guid PayInsuranceTableListID, string EmployeeCode, string EmployeeName, string SocialInsuranceCode, string Condition, decimal Salary, string Time, int TermAbsent, int ProgressAbsent, decimal Money, int Type, string Description)
        {
            string[] myParams = new string[] { "@C66aHDID", "@PayInsuranceTableListID", "@EmployeeCode", "@EmployeeName", "@SocialInsuranceCode", "@Condition", "@Salary", "@Time", "@TermAbsent", "@ProgressAbsent", "@Money", "@Type", "@Description" };
            object[] myValues = new object[] { C66aHDID, PayInsuranceTableListID, EmployeeCode, EmployeeName, SocialInsuranceCode, Condition, Salary, Time, TermAbsent, ProgressAbsent, Money, Type, Description };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteNonQuery(myTransaction, "HRM_PAYINSURANCE_C66AHD_Update", myParams, myValues);
        }

        [Category("Primary Key"), DisplayName("C66aHDID")]
        public Guid C66aHDID
        {
            get
            {
                return this.m_C66aHDID;
            }
            set
            {
                this.m_C66aHDID = value;
            }
        }

        [DisplayName("Condition"), Category("Column")]
        public string Condition
        {
            get
            {
                return this.m_Condition;
            }
            set
            {
                this.m_Condition = value;
            }
        }

        [Category("Column"), DisplayName("Description")]
        public string Description
        {
            get
            {
                return this.m_Description;
            }
            set
            {
                this.m_Description = value;
            }
        }

        [Category("Column"), DisplayName("EmployeeCode")]
        public string EmployeeCode
        {
            get
            {
                return this.m_EmployeeCode;
            }
            set
            {
                this.m_EmployeeCode = value;
            }
        }

        [Category("Column"), DisplayName("EmployeeName")]
        public string EmployeeName
        {
            get
            {
                return this.m_EmployeeName;
            }
            set
            {
                this.m_EmployeeName = value;
            }
        }

        [DisplayName("Money"), Category("Column")]
        public decimal Money
        {
            get
            {
                return this.m_Money;
            }
            set
            {
                this.m_Money = value;
            }
        }

        [Category("Column"), DisplayName("PayInsuranceTableListID")]
        public Guid PayInsuranceTableListID
        {
            get
            {
                return this.m_PayInsuranceTableListID;
            }
            set
            {
                this.m_PayInsuranceTableListID = value;
            }
        }

        public string ProductName
        {
            get
            {
                return "Class HRM_PAYINSURANCE_C66AHD";
            }
        }

        public string ProductVersion
        {
            get
            {
                return "1.0.0.0";
            }
        }

        [DisplayName("ProgressAbsent"), Category("Column")]
        public int ProgressAbsent
        {
            get
            {
                return this.m_ProgressAbsent;
            }
            set
            {
                this.m_ProgressAbsent = value;
            }
        }

        [DisplayName("Salary"), Category("Column")]
        public decimal Salary
        {
            get
            {
                return this.m_Salary;
            }
            set
            {
                this.m_Salary = value;
            }
        }

        [Category("Column"), DisplayName("SocialInsuranceCode")]
        public string SocialInsuranceCode
        {
            get
            {
                return this.m_SocialInsuranceCode;
            }
            set
            {
                this.m_SocialInsuranceCode = value;
            }
        }

        [Category("Column"), DisplayName("TermAbsent")]
        public int TermAbsent
        {
            get
            {
                return this.m_TermAbsent;
            }
            set
            {
                this.m_TermAbsent = value;
            }
        }

        [Category("Column"), DisplayName("Time")]
        public string Time
        {
            get
            {
                return this.m_Time;
            }
            set
            {
                this.m_Time = value;
            }
        }

        [DisplayName("Type"), Category("Column")]
        public int Type
        {
            get
            {
                return this.m_Type;
            }
            set
            {
                this.m_Type = value;
            }
        }
    }
}

